Skip to content

Enhance Alternator API#158

Merged
vponomaryov merged 9 commits intoscylladb:mainfrom
scylladb-zpp-2025-alternator-rs-driver:backport
May 7, 2026
Merged

Enhance Alternator API#158
vponomaryov merged 9 commits intoscylladb:mainfrom
scylladb-zpp-2025-alternator-rs-driver:backport

Conversation

@m-szymon
Copy link
Copy Markdown

Refactor ConnectionConf and add custom credentials support for Alternator

  • Refectored ConnectionConf so it has a database specific
    DbConnectionConf field. This way the database specific code is contained
    inside the scripting folder.
  • Added Alternator specific credential options to its DbConnectionConf
    and used them in connect.
  • Edited both the CQL and Alternator config to not serialize
    passwords/secrets. This stops the secrets from being saved to generated
    raports.

The Alternator credential options work as follows:

  • if aws-credentials is specified, the default AWS SDK credentials
    flow will be used, i.e. the SDK will try to fetch the credentials from
    the environment
  • The access-key-id and secret-access-key options can be used to
    specify the keys, otherwise the default empty values ("") are used

Add support for DynamoDB Sets to Alternator.

Implemented support for passing and receiving of DynamoDB Sets to Rune.

They are implemented as objects with exactly one key with a special
name. The values are stored as a vector of appropriate types.
Convenience functions used to create the sets are provided to Rune.


Implement batch_get_item and batch_write_item.

Implemented the functions and added workflows that demonstrates the
usage.

Batch operations support the get_unprocessed option that disables the
auto pagination feature and allows the user to do it manually from rune.

Implementing the auto pagination feature required editing some existing
traits.

Follow-up #138

ConnectionConf now only has fields that are shared between different databases.
Database specific fields are moved to DbConnectionConf inside the scripting folder.

(cherry picked from commit 5e4661e)
Comment thread src/scripting/alternator/config.rs
Comment thread src/scripting/alternator/functions.rs Outdated
Comment thread workloads/alternator/manual_batch_operations.rn
Comment thread workloads/alternator/manual_batch_operations.rn Outdated
Comment thread workloads/alternator/manual_batch_operations.rn Outdated
Comment thread workloads/alternator/manual_batch_operations.rn Outdated
@m-szymon
Copy link
Copy Markdown
Author

m-szymon commented May 5, 2026

@vponomaryov thanks for already reviewing.
@stopnoanime please have a look on the comments.

@stopnoanime
Copy link
Copy Markdown

I made a PR with the fixes in our repo: scylladb-zpp-2025-alternator-rs-driver#45

@vponomaryov
Copy link
Copy Markdown
Collaborator

vponomaryov commented May 5, 2026

@m-szymon
Why is it in draft state?
What is the expectation for the review changes merging? Going to be part of this PR? or a follow-up one?

@m-szymon
Copy link
Copy Markdown
Author

m-szymon commented May 6, 2026

@m-szymon Why is it in draft state? What is the expectation for the review changes merging? Going to be part of this PR? or a follow-up one?

@vponomaryov you were too quick with review - I created draft, but I was not sure if we want to add something, especially that we were syncing with some other changes from master.

I will rebase and include fixes in this PR.

The config allows for specifying the credentials as command line arguments.
By specifying the aws-credentials option the SDK will fetch credentials from the environment.

(cherry picked from commit 1d37fa9)
Used serde(skip_serializing) to avoid serializing secret fields.

(cherry picked from commit 62669ca)
Sets are represented as special objects with a single specific key.
The items of the sets are stored in a vector.

(cherry picked from commit d775dfc)
PaginationToken will allow for retrying both normal Query requests and batch requests.

(cherry picked from commit 0313ea2)
Implemented the functions with automatic retry and added a workflow that demonstrates the usage.

(cherry picked from commit 7cac86f)
Added new `get_unprocessed` to batch write and get.
Modified `handle_request` and added `format_batch_result` to properly return the unprocessed items.

(cherry picked from commit a0f9ecb)
@vponomaryov
Copy link
Copy Markdown
Collaborator

vponomaryov commented May 7, 2026

@m-szymon
There is another latte PR that touches alternator code: #159
So, I would like to get this PR in and then rebase that PR on top of the actual alternator code state.

Or, if it requires some more time, I can merge this one as-is so small review updates PR could be merged later not having merge conflicts...

@m-szymon
Copy link
Copy Markdown
Author

m-szymon commented May 7, 2026

@vponomaryov I pushed rebased version with fixes that were discussed.
However we noticed an issue with Batch operations scylladb-zpp-2025-alternator-rs-driver#46, that we wanted to fix first.
But we can provide fix in the next PR.

@m-szymon m-szymon marked this pull request as ready for review May 7, 2026 09:13
@m-szymon
Copy link
Copy Markdown
Author

m-szymon commented May 7, 2026

Ah, I only now noticed that @stopnoanime already created some fix scylladb-zpp-2025-alternator-rs-driver#47, so maybe you could wait a moment with merging.

@m-szymon m-szymon requested a review from vponomaryov May 7, 2026 10:39
@m-szymon
Copy link
Copy Markdown
Author

m-szymon commented May 7, 2026

@vponomaryov it is ready - there is one additional commit.

@vponomaryov vponomaryov merged commit 3dc41b2 into scylladb:main May 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants